/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.produccion.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author carlosdavid
 */
@Entity
@Table(name = "documento", catalog = "base_prod", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Documento.findAll", query = "SELECT d FROM Documento d"),
    @NamedQuery(name = "Documento.findByIdDocumento", query = "SELECT d FROM Documento d WHERE d.idDocumento = :idDocumento"),
    @NamedQuery(name = "Documento.findByNumDocumento", query = "SELECT d FROM Documento d WHERE d.numDocumento = :numDocumento"),
    @NamedQuery(name = "Documento.findByCantidad", query = "SELECT d FROM Documento d WHERE d.cantidad = :cantidad"),
    @NamedQuery(name = "Documento.findByFecha", query = "SELECT d FROM Documento d WHERE d.fecha = :fecha"),
    @NamedQuery(name = "Documento.findByIdUsuario", query = "SELECT d FROM Documento d WHERE d.idUsuario = :idUsuario"),
    @NamedQuery(name = "Documento.findByFechaMod", query = "SELECT d FROM Documento d WHERE d.fechaMod = :fechaMod")})
public class Documento implements Serializable {
    @OneToMany(mappedBy = "idDocumento")
    private List<DocumentoDetalle> documentoDetalleList;
    @Column(name = "Documento", length = 15)
    private String documento;
    @Column(name = "idTercero", length = 11)
    private String idTercero;
    @Column(name = "idcCosto", length = 5)
    private String idcCosto;
    @Column(name = "idBodega", length = 4)
    private String idBodega;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDocumento", nullable = false)
    private Integer idDocumento;
    @Column(name = "numDocumento", length = 15)
    private String numDocumento;
    @Column(name = "cantidad", length = 255)
    private String cantidad;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name = "idUsuario", length = 15)
    private String idUsuario;
    @Column(name = "fechaMod")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaMod;

    public Documento() {
    }

    public Documento(Integer idDocumento) {
        this.idDocumento = idDocumento;
    }

    public Integer getIdDocumento() {
        return idDocumento;
    }

    public void setIdDocumento(Integer idDocumento) {
        this.idDocumento = idDocumento;
    }

    public String getNumDocumento() {
        return numDocumento;
    }

    public void setNumDocumento(String numDocumento) {
        this.numDocumento = numDocumento;
    }

    public String getCantidad() {
        return cantidad;
    }

    public void setCantidad(String cantidad) {
        this.cantidad = cantidad;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(String idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Date getFechaMod() {
        return fechaMod;
    }

    public void setFechaMod(Date fechaMod) {
        this.fechaMod = fechaMod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDocumento != null ? idDocumento.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Documento)) {
            return false;
        }
        Documento other = (Documento) object;
        if ((this.idDocumento == null && other.idDocumento != null) || (this.idDocumento != null && !this.idDocumento.equals(other.idDocumento))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.produccion.entity.Documento[ idDocumento=" + idDocumento + " ]";
    }

    public String getDocumento() {
        return documento;
    }

    public void setDocumento(String documento) {
        this.documento = documento;
    }

    public String getIdTercero() {
        return idTercero;
    }

    public void setIdTercero(String idTercero) {
        this.idTercero = idTercero;
    }

    public String getIdcCosto() {
        return idcCosto;
    }

    public void setIdcCosto(String idcCosto) {
        this.idcCosto = idcCosto;
    }

    public String getIdBodega() {
        return idBodega;
    }

    public void setIdBodega(String idBodega) {
        this.idBodega = idBodega;
    }

    @XmlTransient
    @JsonIgnore
    public List<DocumentoDetalle> getDocumentoDetalleList() {
        return documentoDetalleList;
    }

    public void setDocumentoDetalleList(List<DocumentoDetalle> documentoDetalleList) {
        this.documentoDetalleList = documentoDetalleList;
    }
    
}
